﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Shapes;
using System.Windows.Media;

namespace WPFDemo
{
    public partial class WPFDemoWindow : Window
    {
        public WPFDemoWindow()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // Initialize the Scaling Modal
            ScalingModal.Instance.Initialize(MainGrid, InnerGrid);
        }


        #region Scaling Modal

        private void AnimationSelectionComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {            
            ScalingModal.Instance.Animation = (ScalingModalExpandCollapseAnimation)Enum.Parse(typeof(ScalingModalExpandCollapseAnimation), (AnimationSelectionComboBox.SelectedItem as ComboBoxItem).Name);
        }
        
        private void ExpandButton_Click(object sender, RoutedEventArgs e)
        {
            var button = new PopUpUserControl();
            ScalingModal.Instance.Expand(button);
        }

        private void BackgroundOpacitySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            ScalingModal.Instance.BackgroundOpacity = e.NewValue;
        }

        #endregion
        


       }
}
